//
// Created by ✎﹏ℳ๓独赏 ☆独醉 on 2023/4/13.
//
#include <stdio.h>
int main(){
    int min,max,temp,count=0;
    scanf("%d%d",&min,&max);
    if(min>max){
        temp = min;
        min = max;
        max = temp;
    }
    for(temp=min;temp<=max;temp++){
        if(temp%400==0 || temp%4==0 && temp%100!=0){
            printf("%d\t",temp);
            count++;
        }
    }
    printf("\ncount=%d",count);
    return 0;
}